# $OpenBSD: README,v 1.4 2015/07/31 11:48:22 sebastia Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

The OpenGroupware system user
=============================

The system user and group intended to run the OpenGroupware application server
is called _opengroupware. The users home directory is ${VARBASE}/opengroupware.

OpenGroupware with apache-httpd-openbsd
=======================================

OpenGroupware requires the mod_ngobjweb module used with Apache. The one
that comes with the OpenGroupware package is built against apache-httpd-openbsd
package, which is based on Apache 1.3. Since the httpd 1.3 configuration is
slightly different than the Apache 2 configuration explained in the OGo WIKI,
here is an example. It's assumed that the httpd and OGo run on the same host.
The httpd listens on port 80, and OGo is listening on its default port 20000.

Per default the web server runs in a chroot environment. Therefore you have to
copy some files into the server's chroot environment:

# mkdir -p ${VARBASE}/www/htdocs/OpenGroupware55.woa
# cp -R ${TRUEPREFIX}/share/opengroupware/www \
	${VARBASE}/www/htdocs/OpenGroupware55.woa/WebServerResources

The web server needs the ngobjweb Apache module loaded. Enable it
by running:

# ${TRUEPREFIX}/sbin/mod_ngobjweb-enable

A sample configuration is installed as example
# cp ${TRUEPREFIX}/share/examples/opengroupware/opengroupware.conf ${VARBASE}/www/conf/modules
# rcctl restart httpd

OpenGroupware configuration example
===================================

Example configuration files for a simple setup are installed with the package.
In order to use them, copy the files as user _opengroupware
to the users Defaults directory:

$ cp ${TRUEPREFIX}/share/examples/opengroupware/*.plist ~/GNUstep/Defaults/

The example assumes you have all the services necessary to run OpenGroupware
on the localhost. These are an LDAP server, an IMAP server, and a PostgreSQL
database.

You can edit the OpenGroupware configuration files manually with your
favourite text editor, but doing so is discouraged. Better use the GNUstep
defaults(1) tool. See the manual page for advice how to use it.

Initializing the database
=========================

Change to the _postgresql user, and create the database:

# su - _postgresql
$ createuser _opengroupware
$ createdb -O _opengroupware -E UTF-8 -t template0 opengroupware
$ psql -U _opengroupware opengroupware < \
	${TRUEPREFIX}/lib/opengroupware/commands/OGo.model/Resources/pg-build-schema.psql

You may have to edit the pg_hba.conf to grant access for the
_opengroupware user.
